package com.situ.hr4.w.dao;

import com.situ.hr4.pojo.ConfigPublicChar;
import com.situ.hr4.pojo.EngageResume;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
//简历管理
public interface JLGLdao {
    //通过id查询职位
    @Select("select a.mre_id,engage_type,b.major_id,major_name,c.major_kind_id,major_kind_name from engage_major_release a,config_major b,config_major_kind c where a.major_id=b.major_id and c.major_kind_id=b.major_kind_id and a.mre_id=#{value}\n")
    Map queryid(int id);

    //通过相关类型查相关记录
    @Select("select * from config_public_char where attribute_kind=#{value}")
    List<ConfigPublicChar> cxxgsj(String s);

    //添加简历
    @Insert("insert into\tengage_resume(human_name,human_major_id,  engage_type,  human_sex,   human_email,  human_telephone,  human_homephone,   human_mobilephone,   human_address,   human_postcode,  human_nationality,  human_birthplace,  human_birthday,  human_race,  human_religion,  human_party,  human_idcard,  human_age,  human_college,   human_educated_degree,  human_educated_years,  human_educated_major,  demand_salary_standard,  human_specility,  human_hobby,  human_history_records,  remark,regist_time,check_status) \n" +
            "\tvalues(#{human_name},#{human_major_id},#{engage_type},#{human_sex},#{human_email},#{human_telephone},#{human_homephone},#{human_mobilephone},#{human_address},#{human_postcode},#{human_nationality},#{human_birthplace},#{human_birthday},#{human_race},#{human_religion},#{human_party},#{human_idcard},#{human_age},#{human_college},#{human_educated_degree},#{human_educated_years},#{human_educated_major},#{demand_salary_standard},#{human_specility},#{human_hobby},#{human_history_records},#{remark},#{regist_time},#{check_status})")
    void tjjl(EngageResume ers);

    //简历筛选列表查询
    @Select("${sql}")
    List<Map> jlsxcx(Map m);

    //通过id查询简历信息
    @Select("select * from engage_resume where res_id=#{value}")
    EngageResume jlxxid(int id);

    //通过简历的职位名称id查询
    @Select("select b.major_id,c.major_kind_id,b.major_name,c.major_kind_name from engage_resume a,config_major b,config_major_kind c where a.human_major_id=b.major_id and b.major_kind_id=c.major_kind_id and res_id=#{value}")
    Map zwmcid(int id);

    //修改简历表推荐人、推荐时间、推荐意见
    @Update("update engage_resume set checker=#{checker},check_time=#{check_time},recomandation=#{recomandation},check_status=#{check_status} where res_id=#{res_id} ")
    void updatejlb(EngageResume ers);
}
